/**
 * Created by shenhai on 15/10/16.
 */


var RoleExamineService = require('../../../services/mis/appuser/roleExamineService');
var messageUtil = require('../../../common/utils/messageUtil');
var toolUtil = require('../../../common/utils/toolUtil');
var mysqlUtil = require('../../../common/utils/mysqlUtil');


exports.roleExamineList = function(req, res) {

    RoleExamineService.roleExamineListService(req, function(err, results) {

        if (err) {
            logger.error('Exception happen when roleExamineList...' + err.message);
            res.json(messageUtil.composeFailedMessage(req, 'Exception happen when roleExamineList...'));
        }else {
            var data = {
                count:results[0]["count"],
                totalPage: results[0]["totalPage"],
                list: results[1]
            };
            res.json(messageUtil.composeSucceededMessage(req, null, data));
        }

    });
};

exports.roleLeifengList = function(req, res) {

    RoleExamineService.roleLeifengListService(req, function(err, results) {

        if (err) {
            logger.error('Exception happen when roleLeifengList...' + err.message);
            res.json(messageUtil.composeFailedMessage(req, 'Exception happen when roleLeifengList...'));
        }else {
            var data = {
                count:results[0]["count"],
                totalPage: results[0]["totalPage"],
                list: results[1]
            };
            res.json(messageUtil.composeSucceededMessage(req, null, data));
        }

    });
};